package com;

import com.google.gson.Gson;

import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;

public class VideoServlet extends HttpServlet {
    public static String videopath = null;
    private final Gson om = new Gson();


    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException {
        response.setContentType("text/html;charset=UTF-8");//设置成返回html页面
        response.setCharacterEncoding("utf-8");
        String tmp="http://localhost:8080/video/";//我自己的tomcat设置
        if (videopath != null) {
            String s = om.toJson(tmp+videopath);
            videopath = null;
            PrintWriter writer = response.getWriter();
            writer.print(s);
            writer.flush();
            writer.close();
        }
    }
}
